package com.sumainfor.pc.dev.controller;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.dev.feign.Zfeign.ZpcMktFeign;
import com.sumainfor.pc.dev.feign.Zfeign.ZzuulFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 关联房源
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-05-07 10:03
 **/
@Controller
@RequestMapping("/correlation")
public class CorrelationPropertiesController {

    @Autowired
    ZpcMktFeign zpcMktFeign;

    @Autowired
    ZzuulFeign zzuulFeign;

    /**
    * <p>
    * 服务中心下拉框
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @GetMapping("/getDeptList")
    public JsonResult getDeptList(){
        return zzuulFeign.getDeptList();
    }
    /**
    * <p>
    * 根据服务中心编号查询项目下拉框
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @GetMapping("/getCommunityList")
    public JsonResult getCommunityList(@RequestParam Map<String,Object> params){
        params.put("MiId",params.get("dept_id"));
        System.out.println("params"+params);
        return zpcMktFeign.getCommunityList(params);
    }

    /**
     * <p>
     * 查询不同状态下的房源
     * </p>
     *
     * @author: zhoucong
     * @since:
     */
    @ResponseBody
    @PostMapping("/selectHousingCondition")
    public JsonResult selectHousingCondition(@RequestBody Map<String,Object> params, Pager pager){
        JsonResult result = new JsonResult();

        return zpcMktFeign.selectHousingCondition(params,pager);
    }
}
